<template>
	<view>
		<baseInfo :cur="PageCur" v-if="PageCur=='baseInfo'" :key="commponent1Key"></baseInfo>
		<danger v-if="PageCur=='danger'" :key="commponent2Key"></danger>
		<check v-if="PageCur=='check'" :key="commponent3Key"></check>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view :class="PageCur=='baseInfo'?'action text-blue':'action text-gray'" @click="NavChange" data-cur="baseInfo">
				<view class='cuIcon-copy'></view>基础信息
			</view>
			<view :class="PageCur=='danger'?'action text-blue':'action text-gray'" @click="NavChange"
				data-cur="danger">
				<view class="cuIcon-light"></view>隐患信息
			</view>
			<view :class="PageCur=='check'?'action text-blue':'action text-gray'" @click="NavChange" data-cur="check">
				<view class="cuIcon-searchlist">
				</view>检测信息
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				PageCur: 'baseInfo',
				commponent1Key: 1,
				commponent2Key: 2,
				commponent3Key: 3,
			}
		},
		onLoad: function(opt) {
			if (!opt.PageCur) {
				this.PageCur = 'baseInfo'
			} else {
				this.PageCur = opt.PageCur;
			}
		},
		methods: {
			NavChange: function(e) {
				console.log(e.currentTarget.dataset.cur)
				this.PageCur = e.currentTarget.dataset.cur
			}

		}
	}
</script>

<style>

</style>
